import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable()
export class ComponentsService {
    constructor(private http: HttpClient) { }

    datagUrl = 'assets/mock-data/KPI-data';

    //测试数据
    getChartDailySalesData() {
        let _url =this.datagUrl + '/m_chart_daily_sales-data.json';
        return this.http.get(_url);
    }

    getUploadId(){
        let _url = "http://192.168.31.141:22742/File/UploadAccessory";
        return this.http.get(_url);
    }
    //月供水量
    getMonthlyWaterSupply(){
        let _url = this.datagUrl + '/monthly-water-supply.json';
        return this.http.get(_url);
    }
    //月供水分布
    getMonthlyWaterDistribution(){
        let _url = this.datagUrl + '/monthly-water-distribution.json';
        return this.http.get(_url);
    }
    //kpi日供水量
    getKPIday(){
        let _url = this.datagUrl + '/day-board.json';
        return this.http.get(_url);
    }
    //今天本月供水分布图
    getThisYearMonth(){
        let _url = this.datagUrl + '/month-this-year-water.json';
        return this.http.get(_url);
    }
    //去年本月供水分布图
    getLastYearMonth(){
        let _url = this.datagUrl + '/month-last-year-water.json';
        return this.http.get(_url);
    }
}